package com.pj.ca.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * 描述：
 *
 * @author pengjun
 * @date 2021/11/3 16:37
 */
@Configuration
@EnableScheduling
public class TimerTaskConfig {
    @Bean
    public TaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
        //线程池大小
        scheduler.setPoolSize(1);
        //线程名字前缀
        scheduler.setThreadNamePrefix("cert-timer-task");
        return scheduler;
    }
}
